﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Dapper.IService;
using Dapper.Model;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace DapperCore.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class DapperController : ControllerBase
    {
        public IUserService _userService;
        public IDapperService _dapperService;
        public DapperController(IUserService userService, IDapperService dapperService)
        {
            this._userService = userService;
            this._dapperService = dapperService;
        }

        [HttpGet]
        public IEnumerable<User> GetUsers()
        {
            return _dapperService.GetList();
        }

    }
}